package com.admin.common.enums;

/**
 * 系统流水
 */
public enum DeclareTypeEnum {
    NORMAL (0, "普通申报"),
    UPGRADE(1, "提标升级");

    private Integer key;
    private String name;

    DeclareTypeEnum(Integer key, String name) {
        this.key = key;
        this.name = name;
    }

    public Integer getKey() {
        return key;
    }


    public String getName() {
        return name;
    }

    public static String getText(Integer key) {
        if (key == null) {
            return null;
        }
        for (DeclareTypeEnum e : DeclareTypeEnum.values()) {
            if (e.getKey().equals(key)) {
                return e.getName();
            }
        }
        return null;
    }

    public static DeclareTypeEnum getEnum(Integer type) {
        if (type == null) {
            return null;
        }
        for (DeclareTypeEnum e : DeclareTypeEnum.values()) {
            if (e.getKey().equals(type)) {
                return e;
            }
        }
        return null;
    }

}
